package util;

import java.util.HashSet;
import java.util.Set;

import org.lwjgl.opengl.GL11;

public class Camera {
    public int minX;
    public int minY;
    public int minZ;
	
    public int maxX;    
    public int maxY;
    public int maxZ;
    
    public int order;
    
    public Camera(int order) {
		minX = 50;
		minY = 50;
		minZ = -500;
		maxX = 200;
		maxY = 200;
		maxZ = 500;
		
		this.order = order;
    }
	
	public Set<Drawable> objectsInWorld = new HashSet<Drawable>();
	
	public void drawScene() {
		// Clear The Screen And The Depth Buffer
		GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);

		// R,G,B,A Set The Color One Time Only
		//GL11.glColor3f(1f, 1f, 1f);
		
		
		for(Drawable d : objectsInWorld) {
			if(d instanceof Point
				&& (int)((Point) d).x > minX
				&& (int)((Point) d).y > minY
				&& (int)((Point) d).z > minZ
				&& (int)((Point) d).x < maxX
				&& (int)((Point) d).y < maxY
				&& (int)((Point) d).z < maxZ) {
				
					d.draw();
			}
		}
	}
}
